package com.yy.studyspringboot.resourcemap;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
public class DemoController {

    @Resource
    private Map<String,Demo> demoMap;

    /**
     * 测试Resource可以注入map
     */
    @GetMapping("testDemo")
    public void ttt(){
        Demo demoA = demoMap.get("DemoA");
        demoA.demoTest();
    }

}
